using UnityEngine;
// [Assembly-CSharp.dll].HomeManager
public class HomeManager : MonoBehaviour
{
    // Fields
    private UnityEngine.UI.Text totalEarning;
    public UnityEngine.GameObject levelPanel;
    public UnityEngine.GameObject settingPanel;
    public UnityEngine.GameObject storePanel;
    public UnityEngine.GameObject exitPanel;
    public UnityEngine.GameObject modeAdPanel;
    public UnityEngine.GameObject spinWheelPanel;
    public UnityEngine.GameObject LoadingScreenOnStart;
    public UnityEngine.Transform loveButton;
    public UnityEngine.Transform challangeButton;
    private string mode;
    public static bool FirstTime;
    
    // Methods
    private void Start()
    {
        var val_9;
        if(mem[536887151] != 0)
        {
                this.LoadingScreenOnStart.SetActive(value:  false);
        }
        else
        {
                this.LoadingScreenOnStart.SetActive(value:  true);
            mem2[0] = 1;
        }
        
        val_9 = 536886631;
        if(mem[536886855] == 0)
        {
                val_9 = 536886631;
        }
        
        if(mem[536886815] >= 4)
        {
                this.OpenPanel(obj:  this.spinWheelPanel);
        }
        
        this.loveButton.GetChild(index:  0).gameObject.SetActive(value:  ((UnityEngine.PlayerPrefs.GetInt(key:  -1610597399)) != 1) ? 1 : 0);
        this.challangeButton.GetChild(index:  0).gameObject.SetActive(value:  ((UnityEngine.PlayerPrefs.GetInt(key:  -1610599907)) != 1) ? 1 : 0);
    }
    private void Update()
    {
        string val_3 = UnityEngine.PlayerPrefs.GetInt(key:  -1610599799, defaultValue:  UnityEngine.PlayerPrefs.GetInt(key:  -1610599799)).ToString();
    }
    public void Play()
    {
        Firebase.Analytics.FirebaseAnalytics.LogEvent(name:  -1610604471);
        mem[536882947] + 56.Play();
        mem2[0] = 1;
        UnityEngine.PlayerPrefs.SetInt(key:  -1610608379, value:  UnityEngine.PlayerPrefs.GetInt(key:  -1610601669));
        UnityEngine.PlayerPrefs.SetInt(key:  -1610608821, value:  0);
        UnityEngine.PlayerPrefs.SetInt(key:  -1610605633, value:  0);
        int val_2 = DG.Tweening.DOTween.KillAll(complete:  false);
        UnityEngine.SceneManagement.SceneManager.LoadScene(sceneBuildIndex:  3);
    }
    public void LoveMode()
    {
        if((UnityEngine.PlayerPrefs.GetInt(key:  -1610597399)) == 1)
        {
                mem[536882947] + 56.Play();
            mem2[0] = 1;
            UnityEngine.PlayerPrefs.SetInt(key:  -1610608821, value:  0);
            UnityEngine.PlayerPrefs.SetInt(key:  -1610605633, value:  1);
            int val_2 = DG.Tweening.DOTween.KillAll(complete:  false);
            UnityEngine.SceneManagement.SceneManager.LoadScene(sceneBuildIndex:  3);
            return;
        }
        
        this.modeAdPanel.SetActive(value:  true);
        this.mode = -1610597401;
        throw new NullReferenceException();
    }
    public void ChallangeMode()
    {
        if((UnityEngine.PlayerPrefs.GetInt(key:  -1610599907)) == 1)
        {
                mem[536882947] + 56.Play();
            mem2[0] = 1;
            UnityEngine.PlayerPrefs.SetInt(key:  -1610608821, value:  1);
            UnityEngine.PlayerPrefs.SetInt(key:  -1610605633, value:  0);
            int val_2 = DG.Tweening.DOTween.KillAll(complete:  false);
            UnityEngine.SceneManagement.SceneManager.LoadScene(sceneBuildIndex:  3);
            return;
        }
        
        this.modeAdPanel.SetActive(value:  true);
        this.mode = -1610599909;
        throw new NullReferenceException();
    }
    public void OnClickUnLockMode()
    {
        System.Action val_1 = 536881997;
        val_1 = new System.Action(object:  this, method:  1610677793);
        mem[536882295].ShowRewardedAd(_successCallBack:  val_1);
    }
    private void UnlockMode()
    {
        System.Action val_1 = 536881997;
        val_1 = new System.Action(object:  this, method:  1610677829);
        mem[536895333].AddJob(newJob:  val_1);
    }
    public void CloseADPanel()
    {
        mem[536882947] + 56.Play();
        this.modeAdPanel.SetActive(value:  false);
    }
    public void ShowLevelSelector()
    {
        mem[536882947] + 56.Play();
        this.levelPanel.SetActive(value:  true);
    }
    public void ShowSetting()
    {
        mem[536882947] + 56.Play();
        this.settingPanel.SetActive(value:  true);
    }
    public void CloseSetting()
    {
        mem[536882947] + 56.Play();
        this.settingPanel.SetActive(value:  false);
    }
    public void CloseLevelSelector()
    {
        mem[536882947] + 56.Play();
        this.levelPanel.SetActive(value:  false);
    }
    public void OpenStore()
    {
        mem[536882947] + 56.Play();
        this.storePanel.SetActive(value:  true);
    }
    public void CloseStore()
    {
        mem[536882947] + 56.Play();
        this.storePanel.SetActive(value:  false);
    }
    public void OnClickExit()
    {
        mem[536882947] + 56.Play();
        this.exitPanel.SetActive(value:  true);
    }
    public void ExitGame()
    {
        mem[536882947] + 56.Play();
        UnityEngine.Application.Quit();
    }
    public void CloseExitPanel()
    {
        mem[536882947] + 56.Play();
        this.exitPanel.SetActive(value:  false);
    }
    public void ShowAdInter()
    {
        mem[536882295].ShowAppOpenAdIfAvailable();
    }
    public void ShowRewarded()
    {
        System.Action val_1 = 536881997;
        val_1 = new System.Action(object:  this, method:  1610677819);
        mem[536882295].ShowRewardedAd(_successCallBack:  val_1);
    }
    private void GiveReward()
    {
        UnityEngine.Debug.Log(message:  -1610596477);
    }
    public void OpenPanel(UnityEngine.GameObject obj)
    {
        mem[536882947].LightImpect();
        mem[536882947] + 56.Play();
        obj.SetActive(value:  true);
    }
    public void ClosePanel(UnityEngine.GameObject obj)
    {
        mem[536882947].LightImpect();
        mem[536882947] + 56.Play();
        obj.SetActive(value:  false);
    }
    public void ShowAd()
    {
        mem[536882295].ShowAd();
    }
    public HomeManager()
    {
    
    }
    private void <UnlockMode>b__18_0()
    {
        mem[536882947] + 80.Play();
        if((System.String.op_Equality(a:  this.mode, b:  -1610597401)) == false)
        {
            goto label_3;
        }
        
        UnityEngine.PlayerPrefs.SetInt(key:  -1610597399, value:  1);
        if(this.loveButton != null)
        {
            goto label_4;
        }
        
        label_3:
        if((System.String.op_Equality(a:  this.mode, b:  -1610599909)) == false)
        {
                return;
        }
        
        UnityEngine.PlayerPrefs.SetInt(key:  -1610599907, value:  1);
        label_4:
        this.challangeButton.GetChild(index:  0).gameObject.SetActive(value:  false);
        this.modeAdPanel.SetActive(value:  false);
    }

}
